<template>
	<view class="downloadLayout">
		<view class="content">
			<navigator :url="`/pages/preview/preview?id=${item._id}`" class="item" 
			v-for="item in downloadList"
			:key="item._id"
			>			
				<image :src="item.imgUrl" mode="aspectFill"></image>
			</navigator>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	import { apiUserWallList } from '@/api/user/index.js'
	import { onLoad } from '@dcloudio/uni-app'
	const scoreList = ref([])
	onLoad(({ type }) => {
		getScoreList(type)
	})
	async function getScoreList(type = '') {
		const { data } = await apiUserWallList({
			pageSize: 15,
			pageNum: 1,
			type,
		})
		uni.setStorageSync('storeClassList', JSON.stringify(data))
		scoreList.value = data.map(item => {
			item.imgUrl = item.smallPicurl.replace('_small.webp','.jpg')
			return item
		})
	}
</script>

<style lang="scss">
	.downloadLayout {
		height: 100%;
		width: 100%;
		.content{
			display: grid;
			grid-template-columns: repeat(3,1fr);
			gap:5rpx;
			padding:5rpx;
			.item{
				height: 440rpx;
				image{
					width: 100%;
					height: 100%;
					display: block;
				}
			}
		}
	}
</style>